package com.ocm.tourism.core.domain;

import com.ocm.tourism.core.exception.TourismRuntimeException;


public enum PeriodTimeType {
    MORNING(1), LUNCH(2), AFTERNOON(4);
    private int type;
    
    private PeriodTimeType(int type){
       this.type = type;
    }
    
    public Integer[] getPeriodTimeNumbers(){
       Integer[] result = new Integer[]{};
       switch (type) {
          case 1:
             result = new Integer[]{1,3,5,7};
             break;
          case 2:
             result = new Integer[]{2,3,6,7};
             break;
          case 4:
            result = new Integer[]{4,5,6,7};
            break;
       }
       return result;
    }
    
    public static PeriodTimeType getType(int type){
       switch (type) {
       case 1:
         return MORNING;
       case 2:
         return LUNCH;
       case 4:
          return AFTERNOON;
      default:
         throw new TourismRuntimeException("PriodTime is not support");
      }
    }
}
